package Application.Mirrors;

import Application.AppJoint;
import Application.Layer.Layer;
import Application.Layer.LayerDelegate;

public class EraseColorMirror extends Mirror{
    private static EraseColorMirror ins = new EraseColorMirror();
    public static EraseColorMirror getInstance(){
        return ins;
    }

    public void eraseColorActivited(Layer layer){
        int height = AppJoint.getInstance().getCanvasHeight();
        int width = AppJoint.getInstance().getCanvasWidth();

        int a = (0x00);
        int r = (0xff);
        int g = (0xff);
        int b = (0xff);

        int argb = (a<<24)|(r<<16)|(g<<8)|(b);

        for(int i=0;i<height;i++){
            for(int j=0;j<width;j++){
                layer.setArgb(i,j,argb);
            }
        }

        LayerDelegate.getInstance().refreshAll();
        AppJoint.getInstance().flush();
    }
}
